<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style></style>
  </head>
  <body>
    <script src="common.js"></script>
    <input type="text" /><br />
    <input type="text" /><br />
    <input type="text" /><br />
    <input type="text" /><br />
    <input type="text" /><br />
    <input type="text" /><br />
    <input type="text" /><br />
    <input type="text" /><br />
    <script>
      var texts = getName$("input");
      console.log(texts);
      for (var i = 0; i < texts.length; i++) {
        texts[i].onfocus = function () {
          for (var j = 0; j < texts.length; j++) {
            texts[j].style.backgroundColor = "";
          }
          this.style.backgroundColor = "rgb(221, 215, 215)";
        };
      }
    </script>
  </body>
</html>
